<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head th:fragment="headInfo">

<meta charset="UTF-8">
<title>登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF -->
<meta name="_csrf" th:content="${_csrf.token}" />
<!-- default header name is X-CSRF-TOKEN -->
<meta name="_csrf_header" th:content="${_csrf.headerName}" />
<link href="/css/bootstrap.min.css" rel="stylesheet">
<script src="/js/jquery-3.1.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<style>
.blog-content-container {
	margin-top: 4.5em;
	background-color: #fff;
}
.foot{
    font-family: "宋体";
    text-align:center;
    color: #FFFFFF;
    background-color:gray;
    padding-top:1.5em;
    padding-bottom:1.5em;
}
</style>

</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top"
		th:fragment="header">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#navbar" aria-expanded="false"
					aria-controls="navbar">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="/">Blog</a>
			</div>
			<div id="navbar" class="collapse navbar-collapse">
				<ul class="nav navbar-nav">
					<li class="nav-item">
                    <a class="nav-link" href="javascript:void(0)" th:attr="url='/blogs?order=new'" >最新 <span class="sr-only">(current)</span></a>
                   </li>
                   <li class="nav-item">
                    <a class="nav-link" href="javascript:void(0)" th:attr="url='/blogs?order=hot'">最热</a>
                    </li>
				</ul>
				<form class="navbar-form navbar-left">
					<div class="form-group">
						<input class="form-control mr-sm-2" type="text" placeholder="搜索" id="indexkeyword" th:value="${keyword}">
					</div>
					<a href="javascript:void(0)" class="btn btn-outline-secondary my-2 my-sm-0" id="indexsearch">
						<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
					</a>
				</form>
				
				<ul class="nav navbar-nav navbar-right" sec:authorize="isAuthenticated()">
					<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" 
					role="button" aria-haspopup="true" aria-expanded="false">
						<span sec:authentication="name"></span><span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a th:href="@{'/u/' + ${#authentication.Principal.username}}">个人主页</a></li>
							<li><a th:href="@{'/u/' + ${#authentication.Principal.username}} + '/profile'">个人设置</a></li>
							<li><a th:href="@{'/u/' + ${#authentication.Principal.username}}+'/blogs/edit'">写博客</a></li>
						</ul>
					</li>
					<form action="/logout" th:action="@{/logout}" method="post" sec:authorize="isAuthenticated()" class="navbar-form navbar-right">
						<input class="btn btn-outline-success " type="submit" value="退出">
					</form>
				</ul>
				<ul class="nav navbar-nav navbar-right" sec:authorize="isAnonymous()">
					<li><a href="/login">登录</a></li> 
					<li><a href="/register">注册</a></li>
				</ul>
		</div><!-- /.navbar-collapse -->
	</div><!-- /.container-fluid -->
	</nav>
</body>
</html>